﻿/*************************************************
网络协议消息包
author：Daixiwei
**************************************************/

using System;
using System.Collections;
using System.Collections.Generic;

namespace taurus.client
{
    /// <summary>
    /// 网络消息回调数据对象
    /// </summary>
    public class MessageResponse
    {
        /// <summary>
        /// 消息数据
        /// </summary>
        public Message messageData;
        /// <summary>
        /// 返回结构值
        /// </summary>
        public int returnCode;
    }


    public class Message 
    {

        /// <summary>
        /// 使用文本，不转换ITObject
        /// </summary>
        public bool useText;

        /// <summary>
        /// 网络协议指令Key
        /// </summary>
        public string command;

        /// <summary>
        /// 参数
        /// </summary>
        public ITObject param;

        /// <summary>
        /// 文本数据
        /// </summary>
        public string textParam;

        /// <summary>
        /// 是否使用udp
        /// </summary>
        public bool useUdp;

        /// <summary>
        /// 网络消息回调
        /// </summary>
        public Action<MessageResponse> callback;

        /// <summary>
        /// 自定义参数
        /// </summary>
        public object data;

        /// <summary>
        /// 网络包最后写入时间
        /// </summary>
        public long lastTime;

        /// <summary>
        /// 网络包返回匹配的GID
        /// </summary>
        public int gid;
    }
}